<form name="editForm" role="form" novalidate (ngSubmit)="save()" #editForm="ngForm">

    <div class="modal-header">
        <h4 class="modal-title" id="myCommentLabel" jhiTranslate="studyng6App.comment.home.createOrEditLabel">Create or edit a Comment</h4>
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true"
                (click)="clear()">&times;</button>
    </div>
    <div class="modal-body">
        <jhi-alert-error></jhi-alert-error>
        <div class="form-group" [hidden]="!comment.id">
            <label for="id" jhiTranslate="global.field.id">ID</label>
            <input type="text" class="form-control" id="id" name="id"
                   [(ngModel)]="comment.id" readonly />
        </div>
        <div class="form-group">
            <label class="form-control-label" jhiTranslate="studyng6App.comment.commentTime" for="field_commentTime">Comment Time</label>
            <div class="d-flex">
                <input id="field_commentTime" type="datetime-local" class="form-control" name="commentTime" [(ngModel)]="comment.commentTime"
                />
            </div>
        </div>
        <div class="form-group">
            <label class="form-control-label" jhiTranslate="studyng6App.comment.commentator" for="field_commentator">Commentator</label>
            <input type="text" class="form-control" name="commentator" id="field_commentator"
                [(ngModel)]="comment.commentator" />
        </div>
        <div class="form-group">
            <label class="form-control-label" jhiTranslate="studyng6App.comment.comment" for="field_comment">Comment</label>
            <input type="text" class="form-control" name="comment" id="field_comment"
                [(ngModel)]="comment.comment" />
        </div>
        <div class="form-group">
            <label class="form-control-label" jhiTranslate="studyng6App.comment.pComment" for="field_pComment">P Comment</label>
            <input type="text" class="form-control" name="pComment" id="field_pComment"
                [(ngModel)]="comment.pComment" />
        </div>
        <div class="form-group">
            <label class="form-control-label" jhiTranslate="studyng6App.comment.content" for="field_content">Content</label>
            <input type="text" class="form-control" name="content" id="field_content"
                [(ngModel)]="comment.content" />
        </div>

        <div class="form-group">
            <label class="form-control-label" jhiTranslate="studyng6App.comment.bookId" for="field_bookId">Book Id</label>
            <select class="form-control" id="field_bookId" name="bookId" [(ngModel)]="comment.bookId" >
                <option [ngValue]="null"></option>
                <option [ngValue]="bookBasicOption.id === comment.bookId?.id ? comment.bookId : bookBasicOption" *ngFor="let bookBasicOption of bookbasics; trackBy: trackBookBasicById">{{bookBasicOption.id}}</option>
            </select>
        </div>
    </div>
    <div class="modal-footer">
        <button type="button" class="btn btn-secondary" data-dismiss="modal" (click)="clear()">
            <span class="fa fa-ban"></span>&nbsp;<span jhiTranslate="entity.action.cancel">Cancel</span>
        </button>
        <button type="submit" [disabled]="editForm.form.invalid || isSaving" class="btn btn-primary">
            <span class="fa fa-save"></span>&nbsp;<span jhiTranslate="entity.action.save">Save</span>
        </button>
    </div>
</form>
